A bounding box. Often used to encompass object's bounds in the world. More...
Public Member Functions | |
| BoundingBox () | |
| BoundingBox (const nkMemory::BufferView< const nkMaths::Vector > &points) | |
| BoundingBox (const nkMaths::Vector ¢er, float cubeHalfSide) | |
| BoundingBox (const nkMaths::Vector ¢er, const nkMaths::Vector &axisAlignedHalfSides) | |
| ~BoundingBox () | |
| nkMemory::BufferView< const nkMaths::Vector > | getPoints () const |
| nkMemory::BufferView< const nkMaths::Vector > | getTransformedPoints () const |
| nkMaths::Vector | getCenter () const |
| nkMaths::Vector | getAxisAlignedSides () const |
| void | setPoints (const nkMemory::BufferView< const nkMaths::Vector > &points) |
| void | setTransformedPoints (const nkMemory::BufferView< const nkMaths::Vector > &points) |
| void | updateTransformation (Node *node) |
| bool | checkAgainst (const Frustum &frustum) const |
A bounding box. Often used to encompass object's bounds in the world.
Can be used to check against a frustum and do culling.
| nkGraphics::BoundingBox::BoundingBox | ( | ) |
Default constructor.
| nkGraphics::BoundingBox::BoundingBox | ( | const nkMemory::BufferView< const nkMaths::Vector > & | points | ) |
Points constructor.
| points | The points forming the bounds, in no particular order. |
| nkGraphics::BoundingBox::BoundingBox | ( | const nkMaths::Vector & | center, |
| float | cubeHalfSide | ||
| ) |
Axis aligned constructor with a constant size on 3 axis.
| center | The center of the box to create. |
| cubeHalfSide | The half extent, uniform along the 3 axis (x, y, z), used to form a cube. |
| nkGraphics::BoundingBox::BoundingBox | ( | const nkMaths::Vector & | center, |
| const nkMaths::Vector & | axisAlignedHalfSides | ||
| ) |
Axis aligned constructor with separated size on 3 axis.
| center | The center of the box to create. |
| axisAlignedHalfSides | The half extents, for each axis. |
| nkGraphics::BoundingBox::~BoundingBox | ( | ) |
Destructor.
| nkMemory::BufferView<const nkMaths::Vector> nkGraphics::BoundingBox::getPoints | ( | ) | const |
| nkMemory::BufferView<const nkMaths::Vector> nkGraphics::BoundingBox::getTransformedPoints | ( | ) | const |
| nkMaths::Vector nkGraphics::BoundingBox::getCenter | ( | ) | const |
| nkMaths::Vector nkGraphics::BoundingBox::getAxisAlignedSides | ( | ) | const |
| void nkGraphics::BoundingBox::setPoints | ( | const nkMemory::BufferView< const nkMaths::Vector > & | points | ) |
Sets new points to use for the box.
| points | The points to use. |
| void nkGraphics::BoundingBox::setTransformedPoints | ( | const nkMemory::BufferView< const nkMaths::Vector > & | points | ) |
Sets new transformed points to use for the box.
| points | The points to use. |
| void nkGraphics::BoundingBox::updateTransformation | ( | Node * | node | ) |
Updates the transformed points with a node transformation.
| node | The node from which to retrieve the transformation. |
| bool nkGraphics::BoundingBox::checkAgainst | ( | const Frustum & | frustum | ) | const |
Checks the box against a frustum to know if it is inside or not.
| frustum | The frustum to check against. |